#include<iostream>
using namespace std;
const int N = 1e4 + 10;
int arr[N];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		int l = 1;
		arr[0] = 1;
		for (int i = 2; i <= n; i++) {
			int num = 0;
			int t = 0;
			for(int j=0;j<l;j++){
				t = arr[j] * i + num;
				arr[j] = t % 10;
				num = t / 10;
			}
			while (num) {
				arr[l++] = num % 10;
				num /= 10;
			}
		}
		cout << l << endl;
	}
	return 0;
}